package com.spring.starter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.Environment;

/**
 * @author TW
 */
@Configuration
@PropertySource("classpath:/app.properties")
public class ExpressiveConfig {
    @Autowired
    public Environment environment;
    @Bean
    public BlankDisc disc(){
        return new BlankDisc(
                environment.getProperty("disc.title")
                , environment.getProperty("disc.artist"));
    }

    public static PropertySourcesPlaceholderConfigurer placeholderConfigurer(){
        return  new PropertySourcesPlaceholderConfigurer();
    }
}
